﻿#include "FITKAbaOutputDefaultVariablesManager.h"
#include <QMetaEnum>
#include <QDebug>


namespace Interface {
FITKAbaOutputDefaultVariablesManager *FITKAbaOutputDefaultVariablesManager::getInstance()
{
    static FITKAbaOutputDefaultVariablesManager mgr;
    return &mgr;
}

QStringList FITKAbaOutputDefaultVariablesManager::getPreSelectedDefaultFeildVaraiables(FITKAbaAbstractStep::FITKAbaStepType stepType, FITKAbaOutputVariable::OutputDomain domain)
{
    //根据domain类型，在默认的preselected场变量基础上进行调整
    QList<FITKAbaOutputVariable::OutputDomain> sameWithWhole{ 
        FITKAbaOutputVariable::OutputDomain::Set, FITKAbaOutputVariable::OutputDomain::Substructure, 
        FITKAbaOutputVariable::OutputDomain::Skin, FITKAbaOutputVariable::OutputDomain::Stringer, 
        FITKAbaOutputVariable::OutputDomain::AssembledFastennerSet };
    QStringList vars{};
    QMetaEnum m = QMetaEnum::fromType<FITKAbaOutputVariable::OutputVariable>();
    if (m_preselectedFieldVariables.contains(stepType))
    {
        if (m_preselectedFieldVariables[stepType].contains(domain))
        {
            for (FITKAbaOutputVariable::OutputVariable var : m_preselectedFieldVariables[stepType][domain])
                vars.append(m.valueToKey(var));
        }
        else if (sameWithWhole.contains(domain))
        {
            for (FITKAbaOutputVariable::OutputVariable var : m_preselectedFieldVariables[stepType][FITKAbaOutputVariable::OutputDomain::WholeModel])
                vars.append(m.valueToKey(var));
        }
        else;
    }
    return vars;
}

QStringList FITKAbaOutputDefaultVariablesManager::getAllDefaultFieldVaraibles(FITKAbaAbstractStep::FITKAbaStepType stepType, 
    FITKAbaOutputVariable::OutputDomain domain)
{
    //根据domain类型，在默认的All场变量基础上进行调整
    QList<FITKAbaOutputVariable::OutputDomain> sameWithWhole{ 
        FITKAbaOutputVariable::OutputDomain::Set, FITKAbaOutputVariable::OutputDomain::Substructure, 
        FITKAbaOutputVariable::OutputDomain::Skin, FITKAbaOutputVariable::OutputDomain::Stringer,
        FITKAbaOutputVariable::OutputDomain::AssembledFastennerSet };
    QStringList vars{};
    QMetaEnum m = QMetaEnum::fromType<FITKAbaOutputVariable::OutputVariable>();
    if (m_allFieldVariables.contains(stepType))
    {
        if (m_allFieldVariables[stepType].contains(domain))
        {
            for (FITKAbaOutputVariable::OutputVariable var : m_allFieldVariables[stepType][domain])
                vars.append(m.valueToKey(var));
        }
        else if (sameWithWhole.contains(domain))
        {
            for (FITKAbaOutputVariable::OutputVariable var : m_allFieldVariables[stepType][FITKAbaOutputVariable::OutputDomain::WholeModel])
                vars.append(m.valueToKey(var));
        }
    }
    return vars;
}

QStringList FITKAbaOutputDefaultVariablesManager::getPreSelectedDefaultHistoryVariables(FITKAbaAbstractStep::FITKAbaStepType stepType, 
    FITKAbaOutputVariable::OutputDomain domain)
{
    //根据domain类型，在默认的preselected历史变量基础上进行调整
    QStringList vars{};
    QMetaEnum m = QMetaEnum::fromType<FITKAbaOutputVariable::OutputVariable>();
    if (m_preselectedHistoryVariables.contains(stepType))
        if (m_preselectedHistoryVariables[stepType].contains(domain))
            for (FITKAbaOutputVariable::OutputVariable var : m_preselectedHistoryVariables[stepType][domain])
                vars.append(m.valueToKey(var));
    return vars;
}

QStringList FITKAbaOutputDefaultVariablesManager::getAllDefaultHistoryVariables(FITKAbaAbstractStep::FITKAbaStepType stepType, FITKAbaOutputVariable::OutputDomain domain)
{
    //根据domain类型，在默认的All历史变量基础上进行调整
    QStringList vars{};
    QMetaEnum m = QMetaEnum::fromType<FITKAbaOutputVariable::OutputVariable>();
    if (m_allHistoryVariables.contains(stepType))
        if (m_allHistoryVariables[stepType].contains(domain))
            for (FITKAbaOutputVariable::OutputVariable var : m_allHistoryVariables[stepType][domain])
                vars.append(m.valueToKey(var));
    return vars;
}

FITKAbaOutputDefaultVariablesManager::FITKAbaOutputDefaultVariablesManager()
{
    this->init();
}

void FITKAbaOutputDefaultVariablesManager::init()
{
    this->initAllField();
    this->initPreField();
    this->initAllHistory();
    this->initPreHistory();
}

void FITKAbaOutputDefaultVariablesManager::initPreField()
{
    //static,general 分析步  WholeModel
    QMetaEnum m = QMetaEnum::fromType<FITKAbaOutputVariable::OutputVariable>();
    bool ok{ false };
    const QStringList staticWholePreVars{ "CDISP","CF","CSTRESS","LE","PE","PEEQ","PEMAG","RF","S","U" };
    for (auto& str : staticWholePreVars)
    {
        int value = m.keyToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::WholeModel].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
    }
    //static,general 分析步  BoltLoad
    const QStringList staticBoltLodaVars{ "CDISP","CF","CSTRESS","RF","U" };
    for (auto& str : staticBoltLodaVars)
    {
        int value = m.keyToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::BoltLoad].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
    }
    //static,general 分析步  CompositeLayup
    const QStringList staticCompLayupVars{ "LE","PE","PEEQ","PEMAG","S" };
    for (auto& str : staticCompLayupVars)
    {
        int value = m.keyToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::CompositeLayup].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
    }
    //static,general 分析步  Interaction
    m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::Interaction].append(FITKAbaOutputVariable::OutputVariable::CDISP);
    m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::Interaction].append(FITKAbaOutputVariable::OutputVariable::CSTRESS);

    //DynamicExplicit 分析步  WholeModel
    const QStringList dXWholeVars{ "A","CSTRESS","EVF","LE","PE","PEEQ","PEEQVAVG","PEVAVG","RF","S","SVAVG","U","V" };
    for (auto& str : dXWholeVars)
    {
        int value = m.keyToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::DynamicExplicit][FITKAbaOutputVariable::OutputDomain::WholeModel].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
    }
    //DynamicExplicit 分析步  BoltLoad
    const QStringList dXBoltVars{ "A","CSTRESS","RF","U","V" };
    for (auto& str : dXBoltVars)
    {
        int value = m.keyToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::DynamicExplicit][FITKAbaOutputVariable::OutputDomain::BoltLoad].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
    }
    //DynamicExplicit 分析步  CompositeLayup
        const QStringList dXCompLayupVars{ "EVF","LE","PE","PEEQ","PEEQVAVG","PEVAVG","S","SVAVG" };
    for (auto& str : dXCompLayupVars)
    {
        int value = m.keyToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::DynamicExplicit][FITKAbaOutputVariable::OutputDomain::CompositeLayup].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
    }
    //DynamicExplicit 分析步  Interaction
        m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::DynamicExplicit][FITKAbaOutputVariable::OutputDomain::Interaction].append(FITKAbaOutputVariable::OutputVariable::CSTRESS);

    //Frequency 分析步  WholeModel
    m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Frequency][FITKAbaOutputVariable::OutputDomain::WholeModel].append(FITKAbaOutputVariable::OutputVariable::U);
    //Frequency 分析步  BoltLoad
        m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Frequency][FITKAbaOutputVariable::OutputDomain::BoltLoad].append(FITKAbaOutputVariable::OutputVariable::U);

    //Buckle 分析步  WholeModel
    m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Buckle][FITKAbaOutputVariable::OutputDomain::WholeModel].append(FITKAbaOutputVariable::OutputVariable::U);
    //Buckle 分析步  BoltLoad
        m_preselectedFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Buckle][FITKAbaOutputVariable::OutputDomain::BoltLoad].append(FITKAbaOutputVariable::OutputVariable::U);

}


void FITKAbaOutputDefaultVariablesManager::initAllField()
{
    //static,general 分析步  WholeModel
    const QStringList staticGeneralWholeModel{ "S", "MISES", "MISESMAX", "TSHR", "CTSHR", "ALPHA", "TRIAX", "VS", "PS", "CS11", "SSAVG", "MISESONLY", "PRESSONLY", "SEQUT", "YIELDPOT",
                                              "E", "VE", "PE", "VEEQ", "PEEQ", "PEEQT", "PEEQMAX", "PEMAG", "PEQC", "EE", "IE", "THE", "NE", "LE", "TE", "TEEQ", "TEVOL", "EEQUT",
                                              "ER", "SE", "SPE", "SEPE", "SEE", "SEP", "SALPHA", "U", "UT", "UR", "RBANG", "RBROT", "RF", "RT", "RM", "CF", "SF", "TF", "VF", "ESF1",
                                              "NFORC", "NFORCSO", "RBFOR", "CSTRESS", "CSTRESSETOS", "CLINELOAD", "CPOINTLOAD", "CDSTRESS", "CDISP", "CDISPETOS", "CTANDIR", "CFORCE",
                                              "CNAREA", "CSTATUS", "PPRESS", "CTF", "CEF", "CU", "CUE", "CUP", "ENER", "ELEN", "ELEDEN", "DAMAGEC", "DAMAGET", "DAMAGEFT", "DAMAGEFC",
                                              "DAMAGEMT", "DAMAGEMC", "DAMAGESHR", "SDEG", "JK", "CFAILURE", "DMICRT", "ERPRATIO", "SHRRATIO", "CSDMG", "CSMAXSCRT", "CSMAXUCRT",
                                              "CSQUADSCRT", "CSQUADUCRT", "SJD", "SJDA", "SJDT", "SJDTA", "EPOT", "EPG", "CECHG", "RECUR", "CECUR", "ECD", "ECDA", "ECDT", "ECDTA",
                                              "NCURS", "VVF", "VVFG", "VVFN", "RD", "MFL", "MFLT", "SVOL", "EVOL", "ESOL", "IVOL", "STH", "COORD", "ENDEN", "ENDENERI", "MISESAVG",
                                              "MISESERI", "CEAVG", "CEERI", "CSTRESSERI", "SDV", "ESDV", "FV", "MFR", "UVARM", "STATUS", "EACTIVE", "MVF" };
    QMetaEnum m = QMetaEnum::fromType<FITKAbaOutputVariable::OutputVariable>();
    bool ok{ false };
    for (const QString& str : staticGeneralWholeModel)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::WholeModel].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
       
    }
    //static,general 分析步  BoltLoad
    const QStringList staticBoltVars{ "U","UT","UR","V","VT","VR","RF","RT","RM","CF","TF","VF","CSTRESS","CSTRESSETOS","CLINELOAD","CPOINTLOAD","CDSTRESS","CDISP",
                                     "CDISPETOS","CTANDIR","CFORCE","CNAREA","CSTATUS","PPRESS","DBS","DBT","DBSF","OPENBC","CRSTS","ENRRT","EFENRRTR","BDSTAT","CSDMG","CSMAXSCRT","CSMAXUCRT",
                                     "CSQUADSCRT","CSQUADUCRT","PHILSM","PSILSM","NT","SJD","SJDA","SJDT","SJDTA","EPOT","RCHG","CECHG","RECUR","CECUR","ECD","ECDA","ECDT","ECDTA","COORD","CSTRESSERI" };
    for (const QString& str : staticBoltVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::BoltLoad].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
       
    }
    //static,general 分析步  Comp
    const QStringList staticCompVars{ "S","MISES","MISESMAX","TSHR","CTSHR","ALPHA","TRIAX","VS","PS","CS11","ALPHAN","SSAVG","MISESONLY","PRESSONLY","SEQUT","YIELDPOT",
                                     "E","VE","PE","VEEQ","PEEQ","PEEQT","PEEQMAX","PEMAG","PEQC","EE","IE","THE","NE","LE","TE","TEEQ","TEVOL","EEQUT","ER","SE","SPE","SEPE","SEE","SEP","SALPHA",
                                     "RBANG","RBROT","SF","ESF1","NFORC","NFORCSO","RBFOR","BF","CORIOMAG","ROTAMAG","CENTMAG","CENTRIFMAG","GRAV","P","HP","TRSHR","TRNOR","CTF","CEF","CU","CUE",
                                     "CUP","ENER","ELEN","ELEDEN","DAMAGEC","DAMAGET","DAMAGEFT","DAMAGEFC","DAMAGEMT","DAMAGEMC","DAMAGESHR","SDEG","JK","CFAILURE","DMICRT","HSNFTCRT","HSNFCCRT",
                                     "HSNMTCRT","HSNMCCRT","ERPRATIO","SHRRATIO","ENRRTXFEM","TEMP","EPG","EFLX","NCURS","VVF","VVFG","VVFN","RD","MFL","MFLT","SVOL","EVOL","ESOL","IVOL","STH",
                                     "ENDEN","ENDENERI","MISESAVG","MISESERI","PEEQAVG","PEEQERI","PEAVG","PEERI","CEAVG","CEERI","EFLAVG","EFLERI","EPGAVG","EPGERI","SDV","ESDV","FV","MFR","UVARM",
                                     "STATUS","EACTIVE","STATUSXFEM","LOADSXFEM","MVF" };
    for (const QString& str : staticCompVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::CompositeLayup].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
    //static,general 分析步  Interaction
    const QStringList staticInterVars{ "CSTRESS","CSTRESSETOS","CLINELOAD","CPOINTLOAD","CDSTRESS","CDISP","CDISPETOS","CTANDIR","CFORCE","CNAREA","CSTATUS","PPRESS","DBS",
                                      "DBT","DBSF","OPENBC","CRSTS","ENRRT","EFENRRTR","BDSTAT","CSDMG","CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","SJD","SJDA","SJDT","SJDTA","ECD","ECDA","ECDT",
                                      "ECDTA","CSTRESSERI" };
    for (const QString& str : staticInterVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::GeneralStatic][FITKAbaOutputVariable::OutputDomain::Interaction].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
    //dx分析步 wholemodel
    const QStringList dxWholeVars{ "S","SVAVG","MISES","MISESMAX","TSHR","CTSHR","TRIAX","VS","PS","SFABRIC","SSAVG","MISESONLY","PRESSONLY","SEQUT","YIELDPOT","E",
                                  "VE","PE","PEVAVG","VEEQ","PEEQ","PEEQVAVG","PEEQT","PEEQMAX","PEMAG","PEQC","NE","NEEQ","NEEQR","LE","TE","TEEQ","TEVOL","EEQUT","ER","ERV","SE","EFABRIC",
                                  "U","UT","UR","V","VT","VR","A","AT","AR","RBANG","RBROT","RF","RT","RM","CF","SF","NFORC","NFORCSO","RBFOR","BF","GRAV","P","HP","IWCONWEP","TRSHR","TRNOR",
                                  "VP","STAGP","SBF","CSTRESS","CDISP","CSLIPR","CTANDIR","CFORCE","CTHICK","FSLIPR","FSLIP","PPRESS","ENER","ELEN","ELEDEN","EDCDEN","EDT","DAMAGEC","DAMAGET",
                                  "DAMAGEFT","DAMAGEFC","DAMAGEMT","DAMAGEMC","DAMAGESHR","SDEG","CFAILURE","DMICRT","HSNFTCRT","HSNFCCRT","HSNMTCRT","HSNMCCRT","ERPRATIO","SHRRATIO","CSDMG",
                                  "CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","DMICRTMAX","EDMICRTMAX","TEMP","TEMPMAVG","VVF","VVFG","VVFN","RD","MFL","MFLT","POR","PABS","SVOL","EVOL",
                                  "EVF","ESOL","IVOL","STH","COORD","SDV","ESDV","FV","MFR","UVARM","EMSF","DENSITY","DENSITYVAVG","STATUS","EACTIVE","RHOE","RHOP","BURNF","DBURNF","TIEDSTATUS",
                                  "TIEADJUST","MVF" };
    for (const QString& str : dxWholeVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::DynamicExplicit][FITKAbaOutputVariable::OutputDomain::WholeModel].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
       
    }
    //dx分析步 Bolt
    const QStringList dxBoltVars{ "U","UT","UR","V","VT","VR","A","AT","AR","RF","RT","RM","CF","CSTRESS","CDISP","CSLIPR","CTANDIR","CFORCE","CTHICK","FSLIPR","FSLIP",
                                 "PPRESS","CSDMG","CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","POR","PABS","COORD","TIEDSTATUS","TIEADJUST" };
    for (const QString& str : dxBoltVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::DynamicExplicit][FITKAbaOutputVariable::OutputDomain::BoltLoad].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
    //dx分析步 comlayup
    const QStringList dxComlayupVars{ "S","SVAVG","MISES","MISESMAX","TSHR","CTSHR","TRIAX","VS","PS","SFABRIC","SSAVG","MISESONLY","PRESSONLY","SEQUT","YIELDPOT","E","VE",
                                     "PE","PEVAVG","VEEQ","PEEQ","PEEQVAVG","PEEQT","PEEQMAX","PEMAG","PEQC","NE","NEEQ","NEEQR","LE","TE","TEEQ","TEVOL","EEQUT","ER","ERV","SE","EFABRIC","RBANG","RBROT",
                                     "SF","NFORC","NFORCSO","RBFOR","BF","GRAV","P","HP","IWCONWEP","TRSHR","TRNOR","VP","STAGP","SBF","CTF","CEF","CVF","CDMG","CDERU","CDERF","CU","CUE","CUF","CUP",
                                     "CUPEQ","ENER","ELEN","ELEDEN","EDCDEN","EDT","DAMAGEC","DAMAGET","DAMAGEFT","DAMAGEFC","DAMAGEMT","DAMAGEMC","DAMAGESHR","SDEG","CFAILURE","DMICRT","HSNFTCRT",
                                     "HSNFCCRT","HSNMTCRT","HSNMCCRT","ERPRATIO","SHRRATIO","DMICRTMAX","EDMICRTMAX","TEMP","TEMPMAVG","VVF","VVFG","VVFN","RD","MFL","MFLT","SVOL","EVOL","EVF","ESOL",
                                     "IVOL","STH","SDV","ESDV","FV","MFR","UVARM","EMSF","DENSITY","DENSITYVAVG","STATUS","EACTIVE","RHOE","RHOP","BURNF","DBURNF","MVF" };
    for (const QString& str : dxComlayupVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::DynamicExplicit][FITKAbaOutputVariable::OutputDomain::CompositeLayup].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
       
    }
    //dx分析步 Interaction
    const QStringList dxInteractionVars{ "CSTRESS","CDISP","CSLIPR","CTANDIR","CFORCE","CTHICK","FSLIPR","FSLIP","PPRESS","CSDMG","CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT" };
    for (const QString& str : dxInteractionVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::DynamicExplicit][FITKAbaOutputVariable::OutputDomain::Interaction].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        else
            qDebug() << "Not support variable: " << str << endl;
    }
    //freq分析步 WholeModel
    const QStringList freqWholeVars{ "S","MISES","MISESMAX","TSHR","CTSHR","ALPHA","TRIAX","VS","PS","CS11","SSAVG","MISESONLY","PRESSONLY","SEQUT","YIELDPOT","E","VE","PE","VEEQ",
                                    "PEEQ","PEEQT","PEEQMAX","PEMAG","PEQC","EE","IE","THE","NE","LE","TE","TEEQ","TEVOL","EEQUT","ER","SE","SPE","SEPE","SEE","SEP","SALPHA","U","UT","UR","RBANG","RBROT","RF",
                                    "RT","RM","CF","SF","TF","VF","ESF1","NFORC","NFORCSO","RBFOR","CSTRESS","CSTRESSETOS","CLINELOAD","CPOINTLOAD","CDSTRESS","CDISP","CDISPETOS","CTANDIR","CFORCE","CNAREA",
                                    "CSTATUS","PPRESS","ENER","ELEN","ELEDEN","DAMAGEC","DAMAGET","DAMAGEFT","DAMAGEFC","DAMAGEMT","DAMAGEMC","DAMAGESHR","SDEG","JK","CFAILURE","DMICRT","ERPRATIO","SHRRATIO",
                                    "CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","PHILSM","PSILSM","NT","SJD","SJDA","SJDT","SJDTA","EPOT","EPG","RCHG","CECHG","RECUR","CECUR","ECD","ECDA","ECDT","ECDTA",
                                    "EFLX","NCURS","VVF","VVFG","VVFN","RD","MFL","MFLT","POR","SVOL","EVOL","ESOL","IVOL","STH","COORD","CSTRESSERI","SDV","ESDV","FV","MFR","UVARM","STATUS","EACTIVE","MVF" };
    for (const QString& str : freqWholeVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Frequency][FITKAbaOutputVariable::OutputDomain::WholeModel].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
    //freq分析步 BoltLoad
    const QStringList freqBoltLoadVars{ "U","UT","UR","RF","RT","RM","CF","TF","VF","CSTRESS","CSTRESSETOS","CLINELOAD","CPOINTLOAD","CDSTRESS","CDISP","CDISPETOS",
                                       "CTANDIR","CFORCE","CNAREA","CSTATUS","PPRESS","CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","PHILSM","PSILSM","NT","SJD","SJDA","SJDT","SJDTA","EPOT",
                                       "RCHG","CECHG","RECUR","CECUR","ECD","ECDA","ECDT","ECDTA","POR","COORD","CSTRESSERI" };
    for (const QString& str : freqBoltLoadVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Frequency][FITKAbaOutputVariable::OutputDomain::BoltLoad].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
    //freq分析步 CompLayup
    const QStringList freqCompLayupVars{ "S","MISES","MISESMAX","TSHR","CTSHR","ALPHA","TRIAX","VS","PS","CS11","SSAVG","MISESONLY","PRESSONLY","SEQUT","YIELDPOT","E",
                                        "VE","PE","VEEQ","PEEQ","PEEQT","PEEQMAX","PEMAG","PEQC","EE","IE","THE","NE","LE","TE","TEEQ","TEVOL","EEQUT","ER","SE","SPE","SEPE","SEE","SEP","SALPHA",
                                        "RBANG","RBROT","SF","ESF1","NFORC","NFORCSO","RBFOR","CTF","CEF","CU","CUE","CUP","ENER","ELEN","ELEDEN","DAMAGEC","DAMAGET","DAMAGEFT","DAMAGEFC","DAMAGEMT",
                                        "DAMAGEMC","DAMAGESHR","SDEG","JK","CFAILURE","DMICRT","ERPRATIO","SHRRATIO","EPG","EFLX","NCURS","VVF","VVFG","VVFN","RD","MFL","MFLT","SVOL","EVOL","ESOL",
                                        "IVOL","STH","ENDEN","ENDENERI","MISESAVG","MISESERI","CEAVG","CEERI","SDV","ESDV","FV","MFR","UVARM","STATUS","EACTIVE","MVF" };
    for (const QString& str : freqCompLayupVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Frequency][FITKAbaOutputVariable::OutputDomain::CompositeLayup].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
    //freq分析步 Inter
    const QStringList freqInterVars{ "CSTRESS","CSTRESSETOS","CLINELOAD","CPOINTLOAD","CDSTRESS","CDISP","CDISPETOS","CTANDIR","CFORCE","CNAREA","CSTATUS","PPRESS",
                                    "CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","SJD","SJDA","SJDT","SJDTA","ECD","ECDA","ECDT","ECDTA","CSTRESSERI" };
    for (const QString& str : freqInterVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Frequency][FITKAbaOutputVariable::OutputDomain::Interaction].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
    //bulk分析步 WholeModel
    const QStringList buckleWholeVars{ "S","MISES","MISESMAX","TSHR","CTSHR","ALPHA","TRIAX","VS","PS","CS11","SSAVG","MISESONLY","PRESSONLY","SEQUT","YIELDPOT",
                                      "E","VE","PE","VEEQ","PEEQ","PEEQT","PEEQMAX","PEMAG","PEQC","EE","IE","THE","NE","LE","TE","TEEQ","TEVOL","EEQUT","ER","SE","SPE","SEPE","SEE","SEP","SALPHA",
                                      "U","UT","UR","RBANG","RBROT","RF","RT","RM","CF","SF","TF","VF","ESF1","NFORC","NFORCSO","RBFOR","CSTRESS","CSTRESSETOS","CLINELOAD","CPOINTLOAD","CDSTRESS",
                                      "CDISP","CDISPETOS","CTANDIR","CFORCE","CNAREA","CSTATUS","PPRESS","ENER","ELEN","ELEDEN","DAMAGEC","DAMAGET","DAMAGEFT","DAMAGEFC","DAMAGEMT","DAMAGEMC",
                                      "DAMAGESHR","SDEG","JK","CFAILURE","DMICRT","ERPRATIO","SHRRATIO","CSDMG","CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","SJD","SJDA","SJDT","SJDTA","EPOT",
                                      "EPG","CECHG","RECUR","CECUR","ECD","ECDA","ECDT","ECDTA","NCURS","VVF","VVFG","VVFN","RD","MFL","MFLT","SVOL","EVOL","ESOL","IVOL","STH","COORD","CSTRESSERI",
                                      "SDV","ESDV","FV","MFR","UVARM","STATUS","EACTIVE","MVF" };
    for (const QString& str : buckleWholeVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Buckle][FITKAbaOutputVariable::OutputDomain::WholeModel].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
     
    }
    //buckle分析步 BoltLoad
    const QStringList buckleBoltLoadVars{ "U","UT","UR","RF","RT","RM","CF","TF","VF","CSTRESS","CSTRESSETOS","CLINELOAD","CPOINTLOAD","CDSTRESS","CDISP","CDISPETOS",
                                         "CTANDIR","CFORCE","CNAREA","CSTATUS","PPRESS","CSDMG","CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","SJD","SJDA","SJDT","SJDTA","EPOT","CECHG","RECUR",
                                         "CECUR","ECD","ECDA","ECDT","ECDTA","COORD","CSTRESSERI" };
    for (const QString& str : buckleBoltLoadVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Buckle][FITKAbaOutputVariable::OutputDomain::BoltLoad].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
    //buckle分析步 CompLayup
    const QStringList buckleCompLayupVars{ "S","MISES","MISESMAX","TSHR","CTSHR","ALPHA","TRIAX","VS","PS","CS11","SSAVG","MISESONLY","PRESSONLY","SEQUT","YIELDPOT",
                                          "E","VE","PE","VEEQ","PEEQ","PEEQT","PEEQMAX","PEMAG","PEQC","EE","IE","THE","NE","LE","TE","TEEQ","TEVOL","EEQUT","ER","SE","SPE","SEPE","SEE","SEP","SALPHA",
                                          "RBANG","RBROT","SF","ESF1","NFORC","NFORCSO","RBFOR","CTF","CEF","CU","CUE","CUP","ENER","ELEN","ELEDEN","DAMAGEC","DAMAGET","DAMAGEFT","DAMAGEFC","DAMAGEMT",
                                          "DAMAGEMC","DAMAGESHR","SDEG","JK","CFAILURE","DMICRT","ERPRATIO","SHRRATIO","EPG","NCURS","VVF","VVFG","VVFN","RD","MFL","MFLT","SVOL","EVOL","ESOL","IVOL",
                                          "STH","ENDEN","ENDENERI","MISESAVG","MISESERI","CEAVG","CEERI","SDV","ESDV","FV","MFR","UVARM","STATUS","EACTIVE","MVF" };
    for (const QString& str : buckleCompLayupVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Buckle][FITKAbaOutputVariable::OutputDomain::CompositeLayup].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
       
    }
    //buckle分析步 Inter
    const QStringList buckleInterVars{ "CSTRESS","CSTRESSETOS","CLINELOAD","CPOINTLOAD","CDSTRESS","CDISP","CDISPETOS","CTANDIR","CFORCE","CNAREA","CSTATUS","PPRESS",
                                      "CSDMG","CSMAXSCRT","CSMAXUCRT","CSQUADSCRT","CSQUADUCRT","SJD","SJDA","SJDT","SJDTA","ECD","ECDA","ECDT","ECDTA","CSTRESSERI" };
    for (const QString& str : buckleInterVars)
    {
        int value = m.keysToValue(str.toLatin1().data(), &ok);
        if (ok)
            m_allFieldVariables[FITKAbaAbstractStep::FITKAbaStepType::Buckle][FITKAbaOutputVariable::OutputDomain::Interaction].append(static_cast<FITKAbaOutputVariable::OutputVariable>(value));
        
    }
}


//PreSelected 场变量
}
